--- title: "哞叫时间" created: 2025-11-28 tags: - 算法 --- # 哞叫时间 ## 题目 [哞叫时间](https://www.acwing.com/problem/content/description/6126/) ![[image-efc25277.png]] ## 思路分析 ![[c6315d941c22772a526279c14937d8f7_720-a6a3d05f.png]] ## 代码实现 ```cpp #include using namespace std; #define endl '\n' const int N=20010; vector abb; priority_queue ,greater> ans; void make_abb(){ for (char ci = 'a'; ci <= 'z'; ci++) { for (char cj = 'a'; cj <= 'z'; cj++) { if (ci != cj) { string pattern; pattern += ci; pattern += cj; pattern += cj; abb.push_back(pattern); } } } } int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); make_abb(); int n,F;cin>>n>>F; string S;cin>>S; for(auto s:abb){ int cnt=0,flag=0; string t=S; for(int i=0;i+2=F){ ans.push(s); } } cout<